<?php
global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();
$list = pdo_get('zh_gjw_reputation',array('uniacid' => $_W['uniacid'],'id'=>$_GPC['id']));
if(checksubmit('submit')){
	$data['sort']=$_GPC['sort'];	
	$data['grade']=$_GPC['grade'];
	$data['money']=$_GPC['money'];
	$data['pubdbnum']=$_GPC['pubdbnum'];
	$data['pubwpnum']=$_GPC['pubwpnum'];
	$data['pubjsnum']=$_GPC['pubjsnum'];
	$data['pubscnum']=$_GPC['pubscnum'];
	$data['pubcunum']=$_GPC['pubcunum'];
	$data['pubusnum']=$_GPC['pubusnum'];
	$data['upnum']=$_GPC['upnum'];
	$data['topnum']=$_GPC['topnum'];
	$data['uniacid']=$_W['uniacid'];
    $data['time']=date('Y-m-d H:i:s',time());

	if($_GPC['id']==''){		
		$res=pdo_insert('zh_gjw_reputation',$data);
		if($res){
			message('添加成功',$this->createWebUrl('reputation',array()),'success');
		}else{
			message('添加失败','','error');
		}
	}else{			
		$res = pdo_update('zh_gjw_reputation', $data, array('id' => $_GPC['id']));
		if($res){
			message('编辑成功',$this->createWebUrl('reputation',array()),'success');
		}else{
			message('编辑失败','','error');
		}
	}
}
include $this->template('web/addreputation');